<h1><%= @quiz.title %></h1>
<h2><%= @quiz.description %></h2>

<% @question.each do |question| %>
  <h3>Question:</h3>
  <%= question.body %><br/>
  <%= form_tag :action => :grade, :id => question.id do %>
    <% if question.anstype == "MultipleChoice" %>
      <% i=0 %>
      <% question.answers.each do |a| %>
        <%= radio_button_tag :answer, i %>
        <%= a.body %><br />
        <% i=i+1 %>
      <% end %>

    <% elsif question.anstype == "MultiAnswer" %>
      <% i=0 %>
      <% question.answers.each do |a| %>
        <%= check_box_tag :check, i, checked = false %>
        <%= a.body %><br />
        <% i=i+1 %>
      <% end %>

    <% elsif question.anstype == "DropDown" %>
      <% a = question.answers.map{|a| a.body} %>
      <%= select_tag :drop, options_for_select(a.zip([1,2,3,4,5,6,7,8,9])) %>

    <% elsif question.anstype == "ShortAnswer" %>
       <%= text_field :short, :size => 60 %>

    <% end %>
  <% end %>
<% end %>
<%= submit_tag "Next"  %>